;
(function() {
	var eml = false;
	$("#email").blur(function() {
		var str = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
		var res = str.test($(this).val());
		if(res) {
			$(this).next().slideUp();
			eml = true;
		} else {
			$(this).next().slideDown();
			eml = false;
		}
	})

	function ge() {
		var card_id, name, mobile, birthday, sex, email, adderss, career, dat = {};
		name = $("#name").val();
		mobile = $("#mobile").val();
		birthday = $("#demo2").text();
		sex = $("#sex").val();
		email = $("#email").val();
		adderss = $("#adderss").val();
		career = $("#career").val();
		dat = {
			"id": MYSHOP.result.shop_card_id,
			"card_id": "1",
			"name": name,
			"mobile": mobile,
			"birthday": birthday,
			"sex": sex,
			"email": email,
			"address": address,
			"career": career
		}
		return dat;
	}

	function res() {
		var err = false;
		$("#Register input").each(function() {
			var l = $(this).val().length;
			if(!l) {
				err = false;
				return err;
			} else err = true;
		});

		return err;
	}
	//*********************注册会员页面**************************//
	//提交注册

	function Register() {
		var r = res(),
			data = {};
		//			if(!r || !eml) {
		//				alert("请完善资料");
		//			} else {
		//				data = ge();
		//				//	common_ajax("put_member_card_apply",data,"zh");
		//				sessionStorage.setItem("carid", "1");
		//				$("#Register").hide();
		//				$("#Payment").show();
		//				$("#succeed-card").show();
		//
		//			}
		$("#Register").hide();
		$("#Payment").show();
		$("#succeed-card").show();
	}

	window.Register = Register;
})();